package com.zzl.bonds.ticket.constant;


/**
 * @author : spp
 * @date : 2022/2/25 14:05
 */
public enum InvalidReasonEnum {

    /**
     * 凭证被拆转
     */
    TICKET_TRANSFER_SUCCESS("1", "母单被拆分"),
    TRANSFER_TICKET_CANCEL("2", "转单失败"),
    TICKET_FINANCE_FAIL("3", "融单失败"),
    TICKET_TRANSFER_CHILD_FAIL("4", "转单留存回滚"),
    TICKET_FINANCE_CHILD_FAIL("5", "融单留存回滚"),

    FINANCE_TICKET_CANCEL("6", "融资撤销"),

    TICKET_FINANCE_SUCCESS("7", "凭证被拆融"),


    TICKET_TRANSFER_FAIL("8", "转单失败"),



    WAITING_PAYMENT("9", "等待兑付"),

    PAID("10", "已经兑付");


    private String value;

    private final String code;

    InvalidReasonEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getStatusName(String code) {
        for (InvalidReasonEnum value : InvalidReasonEnum.values()) {
            if (value.code.equals(code)) {
                return value.value;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

}
